package com.cjl.multi_thread.aqs;

import java.util.concurrent.atomic.AtomicInteger;

public class HalfAtomic {
    private AtomicInteger atomicInteger = new AtomicInteger(0);

    public void increament(){
        for (;;){
            int i = atomicInteger.get();
            boolean b = atomicInteger.compareAndSet(i, ++i);
            if (b){
                break;
            }
        }
    }
}
